﻿namespace ModularAndPlugin.WebApp.MVCComposition
{
    using System.Web.Mvc;

    /// <summary>
    /// Provides view engine support for imported areas.
    /// </summary>
    public class AspxViewEngine : WebFormViewEngine
    {

        #region Constructor
        /// <summary>
        /// Initialises a new instance of <see cref="ARazorViewEngine" />.
        /// </summary>
        public AspxViewEngine(string loca)
        {
            string location = loca.Trim().TrimEnd('/');
            MasterLocationFormats = new[]
                                    {
                                       location+ "/Views/{1}/{0}.master"
                                    };

            ViewLocationFormats = new[]
                                    {
                                       location+ "/Views/{1}/{0}.aspx"
                                    };

            AreaPartialViewLocationFormats = new[]
                                    {
                                        location+"/Views/{1}/{0}.ascx"
                                    };
        }
        #endregion
    }
}
